# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.ConvertRegionPricesResponse do
  @moduledoc """
  Response message for ConvertRegionPrices.

  ## Attributes

  *   `convertedOtherRegionsPrice` (*type:* `GoogleApi.AndroidPublisher.V3.Model.ConvertedOtherRegionsPrice.t`, *default:* `nil`) - Converted other regions prices in USD and EUR, to use for countries where Play doesn't support a country's local currency.
  *   `convertedRegionPrices` (*type:* `%{optional(String.t) => GoogleApi.AndroidPublisher.V3.Model.ConvertedRegionPrice.t}`, *default:* `nil`) - Map from region code to converted region price.
  *   `regionVersion` (*type:* `GoogleApi.AndroidPublisher.V3.Model.RegionsVersion.t`, *default:* `nil`) - The region version at which the prices were generated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :convertedOtherRegionsPrice =>
            GoogleApi.AndroidPublisher.V3.Model.ConvertedOtherRegionsPrice.t() | nil,
          :convertedRegionPrices =>
            %{
              optional(String.t()) => GoogleApi.AndroidPublisher.V3.Model.ConvertedRegionPrice.t()
            }
            | nil,
          :regionVersion => GoogleApi.AndroidPublisher.V3.Model.RegionsVersion.t() | nil
        }

  field(:convertedOtherRegionsPrice,
    as: GoogleApi.AndroidPublisher.V3.Model.ConvertedOtherRegionsPrice
  )

  field(:convertedRegionPrices,
    as: GoogleApi.AndroidPublisher.V3.Model.ConvertedRegionPrice,
    type: :map
  )

  field(:regionVersion, as: GoogleApi.AndroidPublisher.V3.Model.RegionsVersion)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.ConvertRegionPricesResponse do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.ConvertRegionPricesResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.ConvertRegionPricesResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
